home *** CD-ROM | disk | FTP | other *** search
- global gTable, debug
-
- on initGlassware
- global gGlassware, gOldGlassware
- if gOldGlassware then
- gGlassware = getOldGlasswareDB()
- exit
- end if
- gGlassware = [:]
- initDB("recipes.v12", "glassware")
- mOrderBy(gTable, "gwID")
- mSelectAll(gTable)
- temp = mGetSelection(gTable, "PropertyList")
- repeat with X = 1 to count(temp)
- thisGlass = symbol(temp[X][#glassware])
- addProp(gGlassware, thisGlass, temp[X])
- deleteProp(gGlassware[thisGlass], #glassware)
- end repeat
- closeDB()
- end
-
- on initGameLevels
- global gGameSetup, gOldGameLevels
- if gOldGameLevels then
- gGameSetup = getOldGameLevelsDB()
- exit
- end if
- gGameSetup = [:]
- initDB("LevelInfo.v12", "LevelInfo")
- mOrderBy(gTable, "level")
- mSelectAll(gTable)
- gGameSetup = mGetSelection(gTable, "PropertyList")
- closeDB()
- repeat with thisLevel in gGameSetup
- thisLevel[#duration] = minutes(thisLevel[#duration])
- thisLevel[#wo1] = seconds(thisLevel[#WaitingOrder1])
- thisLevel[#wo2] = seconds(thisLevel[#WaitingOrder2])
- thisLevel[#wo3] = seconds(thisLevel[#WaitingOrder3])
- thisLevel[#wo4] = seconds(thisLevel[#WaitingOrder4])
- deleteProp(thisLevel, #WaitingOrder1)
- deleteProp(thisLevel, #WaitingOrder2)
- deleteProp(thisLevel, #WaitingOrder3)
- deleteProp(thisLevel, #WaitingOrder4)
- thisLevel[#ws1] = seconds(thisLevel[#waitingServe1])
- thisLevel[#ws2] = seconds(thisLevel[#waitingServe2])
- thisLevel[#ws3] = seconds(thisLevel[#WaitingServe3])
- deleteProp(thisLevel, #waitingServe1)
- deleteProp(thisLevel, #waitingServe2)
- deleteProp(thisLevel, #WaitingServe3)
- thisLevel[#newCharacterMinInterval] = seconds(thisLevel[#newCharacterMinInterval])
- thisLevel[#newCharacterMaxInterval] = seconds(thisLevel[#newCharacterMaxInterval])
- thisLevel[#orderAnticChance] = integer(100 * thisLevel[#AnticOrderLikely])
- thisLevel[#serveAnticChance] = integer(100 * thisLevel[#AnticServeLikely])
- thisLevel[#postDrinkAnticChance] = integer(100 * thisLevel[#postDrinkAnticLikely])
- thisLevel[#postDrinkStayChance] = integer(100 * thisLevel[#stayLikely])
- deleteProp(thisLevel, #AnticOrderLikely)
- deleteProp(thisLevel, #AnticServeLikely)
- deleteProp(thisLevel, #postDrinkAnticLikely)
- deleteProp(thisLevel, #stayLikely)
- end repeat
- end
-
- on initFlashRects
- global gFlashRects, gOldFlashRects
- if gOldFlashRects then
- gFlashRects = getOldFlashRectsDB()
- demoCharactersOnly(gFlashRects)
- exit
- end if
- gFlashRects = [:]
- initDB("characters.v12", "SpecialRec")
- mOrderBy(gTable, "CHname")
- mSelectAll(gTable)
- mGoFirst(gTable)
- temp = mGetSelection(gTable, "PropertyList")
- closeDB()
- repeat with X = 1 to count(temp)
- thisChar = symbol(temp[X][#CHNAME])
- if voidp(gFlashRects[thisChar]) then
- gFlashRects[thisChar] = [:]
- end if
- addProp(gFlashRects[thisChar], symbol(temp[X][#action]), value("rect" & temp[X][#SPECIALREC]))
- end repeat
- end
-
- on demoCharactersOnly trimList
- global gDemoVersion, gDemoCharacters
- if gDemoVersion then
- maxCount = count(trimList)
- repeat with X = maxCount down to 1
- if not findPos(gDemoCharacters, getPropAt(trimList, X)) then
- deleteAt(trimList, X)
- end if
- end repeat
- end if
- end
-
- on initCharInfo
- global gImplementedCharacters, gOldCharInfo
- if gOldCharInfo then
- gImplementedCharacters = getOldCharInfoDB()
- demoCharactersOnly(gImplementedCharacters)
- exit
- end if
- gImplementedCharacters = [:]
- initDB("characters.v12", "Tcharacter_name")
- mSelectAll(gTable)
- temp = mGetSelection(gTable, "PropertyList")
- if debug then
- put "Found" && count(temp) && "characters names"
- end if
- repeat with X = 1 to count(temp)
- thisChar = symbol(temp[X][#character_code])
- addProp(gImplementedCharacters, thisChar, temp[X])
- thisChar2 = gImplementedCharacters[thisChar]
- deleteProp(thisChar2, #character_code)
- deleteProp(thisChar2, #id)
- tempGlassXY = value(thisChar2[#glassXY])
- if voidp(tempGlassXY) then
- debugAlert("Problem with glassXY for" && thisChar && thisChar2[#glassXY])
- thisChar2[#glassXY] = [#def: point(0, 0)]
- else
- thisChar2[#glassXY] = tempGlassXY
- end if
- thisChar2[#regPoint] = value("point" & thisChar2[#regPoint])
- thisChar2[#RegPointMouth] = value("point" & thisChar2[#RegPointMouth])
- thisChar2[#SexPref] = value("list" & thisChar2[#SexPref])
- if thisChar2[#IMPATIENCE] = EMPTY then
- thisChar2[#IMPATIENCE] = 1.0
- else
- thisChar2[#IMPATIENCE] = value(thisChar2[#IMPATIENCE])
- end if
- thisChar2[#P1A] = value(thisChar2[#POS1ALLOW])
- thisChar2[#P2A] = value(thisChar2[#POS2ALLOW])
- thisChar2[#P3A] = value(thisChar2[#POS3ALLOW])
- deleteProp(thisChar2, #POS1ALLOW)
- deleteProp(thisChar2, #POS2ALLOW)
- deleteProp(thisChar2, #POS3ALLOW)
- if thisChar2[#POS1FREE] = EMPTY then
- thisChar2[#P1F] = []
- else
- thisChar2[#P1F] = value(thisChar2[#POS1FREE])
- end if
- deleteProp(thisChar2, #POS1FREE)
- if thisChar2[#POS2FREE] = EMPTY then
- thisChar2[#P2F] = []
- else
- thisChar2[#P2F] = value(thisChar2[#POS2FREE])
- end if
- deleteProp(thisChar2, #POS2FREE)
- if thisChar2[#POS3FREE] = EMPTY then
- thisChar2[#P3F] = []
- else
- thisChar2[#P3F] = value(thisChar2[#POS3FREE])
- end if
- deleteProp(thisChar2, #POS3FREE)
- if thisChar2[#UNDERAGEM] = EMPTY then
- thisChar2[#UM] = 0
- else
- thisChar2[#UM] = value(thisChar2[#UNDERAGEM])
- end if
- deleteProp(thisChar2, #UNDERAGEM)
- if thisChar2[#UNDERAGED] = EMPTY then
- thisChar2[#UD] = 0
- else
- thisChar2[#UD] = value(thisChar2[#UNDERAGED])
- end if
- deleteProp(thisChar2, #UNDERAGEM)
- if thisChar2[#UNDERAGEY] = EMPTY then
- thisChar2[#UY] = 0
- else
- thisChar2[#UY] = value(thisChar2[#UNDERAGEY])
- end if
- deleteProp(thisChar2, #UNDERAGEY)
- thisChar2[#UF] = value(thisChar2[#UNDERAGEFREQ])
- deleteProp(thisChar2, #UNDERAGEFREQ)
- thisChar2[#MINLEVEL] = value(thisChar2[#MINLEVEL])
- if thisChar2[#EXCLUDECHAR] = "VOID" then
- thisChar2[#EXCLUDECHAR] = []
- next repeat
- end if
- thisChar2[#EXCLUDECHAR] = value(thisChar2[#EXCLUDECHAR])
- end repeat
- closeDB()
- end
-
- on reinitializeCharacters
- initCharActions()
- end
-
- on reinitializeBarTopManager
- global gBarTopManager, gRegisterBell
- gBarTopManager = new(script("Bar Spot Manager"))
- mInitialize(gBarTopManager)
- gRegisterBell = new(script("Register Bell"))
- end
-
- on startNewGame
- global gBarTopManager, gPlayerTips, gGameLevel, gPlayerCardWarnings, gGenderMishaps, gRecipeWindowWarnings, gWastingLiquorWarnings, gRecipeWindowOpenTime, gPlayerDrinkTickets, gWarnedAboutGlassesUnderBar, gLastSavedGameName
- gLastSavedGameName = EMPTY
- gPlayerDrinkTickets = 0
- gRecipeWindowOpenTime = 0
- gRecipeWindowWarnings = 0
- gWastingLiquorWarnings = 0
- gWarnedAboutGlassesUnderBar = 0
- gGenderMishaps = 0
- reinitializeCharacters()
- gPlayerTips = 0
- gPlayerCardWarnings = 0
- end
-
- on initCharActions
- global gCharacterActions, gImplementedCharacters, gOldCharActions, gCharChildren
- startTimer()
- gCharChildren = [:]
- if debug then
- put "Before readcharactions" && the timer
- end if
- if gOldCharActions then
- if voidp(gCharacterActions) then
- gCharacterActions = getOldCharActionsDB()
- end if
- demoCharactersOnly(gCharacterActions)
- else
- gCharacterActions = [:]
- initDB("characters.v12", "Taction_list")
- end if
- if debug then
- put "Before repeat" && the timer
- end if
- repeat with Y = count(gImplementedCharacters) down to 1
- charCode = getPropAt(gImplementedCharacters, Y)
- addProp(gCharChildren, charCode, new(script("Character persistent parent script"), charCode))
- if not gOldCharActions then
- addProp(gCharacterActions, charCode, readCharacterDatabase(charCode))
- end if
- charActions = gCharChildren[charCode][#pCharacterActions]
- if debug >= 3 then
- checkCharActions(gCharChildren[charCode])
- end if
- if (charActions = VOID) or (charActions = [:]) then
- put "Unless you are resetting the database right now, this is very bad. There are no actions for" && charCode
- deleteAt(gImplementedCharacters, Y)
- next repeat
- end if
- if debug >= 3 then
- put "Put in repeat" && the timer
- end if
- end repeat
- closeDB()
- if debug then
- put "Before verification" && the timer
- end if
- repeat with Y = 1 to count(gImplementedCharacters)
- charCode = getPropAt(gImplementedCharacters, Y)
- verifyLabels = 0
- if verifyLabels then
- spriteNum = barSlotToSprite(1)
- sprite(spriteNum).member = flashMember(charCode)
- updateStage()
- sprite(spriteNum).member.fileName = sprite(spriteNum).member.fileName
- charActions = getCharActions(charCode)
- repeat with zzz = 1 to count(charActions)
- actions = charActions[zzz]
- steps = actions[1]
- if not listp(steps) then
- put "No valid steps for" && getPropAt(charActions, zzz) && "for character" && charCode
- next repeat
- end if
- repeat with stepNum = 1 to count(steps)
- case getPropAt(steps, stepNum) of
- #anim:
- if findLabel(sprite(spriteNum), steps[stepNum]) = 0 then
- err = "Missing label" && steps[stepNum] && "in Flash member for character" && charCode && "for action" && getPropAt(charActions, zzz)
- end if
- #vo:
- soundFile = VOpath(charCode, steps[stepNum])
- if authoring() then
- if not FileExists(soundFile) then
- put "Missing sound file" && soundFile
- end if
- end if
- #V0:
- put "Error, should be Vee-Oh, not Vee-Zero" && charCode && getPropAt(charActions, zzz) && VOpath(charCode, steps[stepNum])
- #RID:
- #otherwise:
- put "Unrecognized action in database:" && getPropAt(steps, stepNum) && steps[stepNum]
- end case
- end repeat
- end repeat
- if debug >= 3 then
- put " in verification" && the timer
- end if
- end if
- end repeat
- if debug then
- put "After verification" && the timer
- end if
- end
-